using UnityEngine;

namespace UnityDefaultSetting.TextDefaultSetting
{
    [CreateAssetMenu(fileName = "TextDefaultTemplateConfig", menuName = "ScriptableObjects/TextDefaultTemplateConfig", order = 1)]
    [System.Serializable]
    public class TextDefaultTemplateConfig : ScriptableObject
    {
        [SerializeField, HideInInspector]
        private bool isInitialized;

        [HideInInspector]
        public bool isEnable =true;

        public TextDefaultSettingConfig textConfig;
        public TextDefaultSettingConfig buttonTextConfig;
        public TextDefaultSettingConfig dropDownItemLabelConfig;
        public TextDefaultSettingConfig dropDownLabelConfig;
        public TextDefaultSettingConfig inputFieldPlaceholderConfig;
        public TextDefaultSettingConfig inputFieldTextConfig;

        private void OnEnable()
        {
            if (isInitialized == false)
            {
                isEnable = true;
                textConfig = Resources.Load<TextDefaultSettingConfig>("TextConfig/TextDefaultSettingConfig");
                buttonTextConfig = Resources.Load<TextDefaultSettingConfig>("TextConfig/ButtonTextDefaultSettingConfig");
                dropDownItemLabelConfig = Resources.Load<TextDefaultSettingConfig>("TextConfig/DropDownItemLabelDefaultSettingConfig");
                dropDownLabelConfig = Resources.Load<TextDefaultSettingConfig>("TextConfig/DropDownLabelDefaultSettingConfig");
                inputFieldPlaceholderConfig = Resources.Load<TextDefaultSettingConfig>("TextConfig/InputFieldPlaceholderDefaultSettingConfig");
                inputFieldTextConfig = Resources.Load<TextDefaultSettingConfig>("TextConfig/InputFieldTextDefaultSettingConfig");
                isInitialized = true;
            }
        }
    }
}

